package main

import (
	"fmt"
	"game/readygo/eventbus"
	"game/readygo/eventbus/test/task"
	"game/readygo/eventbus/test/test1"
	"game/readygo/eventbus/test/test2"
	"reflect"
)

func main() {
	eventbus.Register(&test1.Test1Handler{})
	eventbus.Register(&test2.Test2Handler{})

	eventbus.PrintComsumers()

	eventbus.Post(&task.Test1Event{})
	eventbus.Post(&task.Test2Event{})
	eventbus.Post(&task.TaskEvent{})

	eventbus.Post(&task.Test1Event{})

	// var inter task.ITaskEvent = &task.TaskEvent{}

	rType := reflect.TypeOf(&task.TaskEvent{})
	iType := reflect.TypeOf((*task.ITaskEvent)(nil))
	fmt.Println(iType, iType.Elem(), rType)
	fmt.Println(rType.Implements(iType.Elem()))
}
